var _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
  return typeof e;
} : function (e) {
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
};

!function (e) {
  var n = "object" == ("undefined" == typeof window ? "undefined" : _typeof(window)) && window || "object" == ("undefined" == typeof self ? "undefined" : _typeof(self)) && self;
  "undefined" != typeof exports ? e(exports) : n && (n.hljs = e({}), "function" == typeof define && define.amd && define([], function () {
    return n.hljs;
  }));
}(function (a) {
  function b(e) {
    return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
  }

  function f(e) {
    return e.nodeName.toLowerCase();
  }

  function h(e, n) {
    var t = e && e.exec(n);
    return t && 0 === t.index;
  }

  function d(e) {
    return r.test(e);
  }

  function c(e) {
    var n,
        t = {},
        r = Array.prototype.slice.call(arguments, 1);

    for (n in e) t[n] = e[n];

    return r.forEach(function (e) {
      for (n in e) t[n] = e[n];
    }), t;
  }

  function E(e) {
    var a = [];
    return function e(n, t) {
      for (var r = n.firstChild; r; r = r.nextSibling) 3 === r.nodeType ? t += r.nodeValue.length : 1 === r.nodeType && (a.push({
        event: "start",
        offset: t,
        node: r
      }), t = e(r, t), f(r).match(/br|hr|img|input/) || a.push({
        event: "stop",
        offset: t,
        node: r
      }));

      return t;
    }(e, 0), a;
  }

  function _(s) {
    function o(e) {
      return e && e.source || e;
    }

    function l(e, n) {
      return new RegExp(o(e), "m" + (s.case_insensitive ? "i" : "") + (n ? "g" : ""));
    }

    !function n(t, e) {
      if (!t.compiled) {
        if (t.compiled = !0, t.keywords = t.keywords || t.beginKeywords, t.keywords) {
          var r = {},
              a = function (t, e) {
            s.case_insensitive && (e = e.toLowerCase()), e.split(" ").forEach(function (e) {
              var n = e.split("|");
              r[n[0]] = [t, n[1] ? Number(n[1]) : 1];
            });
          };

          "string" == typeof t.keywords ? a("keyword", t.keywords) : u(t.keywords).forEach(function (e) {
            a(e, t.keywords[e]);
          }), t.keywords = r;
        }

        t.lexemesRe = l(t.lexemes || /\w+/, !0), e && (t.beginKeywords && (t.begin = "\\b(" + t.beginKeywords.split(" ").join("|") + ")\\b"), t.begin || (t.begin = /\B|\b/), t.beginRe = l(t.begin), t.end || t.endsWithParent || (t.end = /\B|\b/), t.end && (t.endRe = l(t.end)), t.terminator_end = o(t.end) || "", t.endsWithParent && e.terminator_end && (t.terminator_end += (t.end ? "|" : "") + e.terminator_end)), t.illegal && (t.illegalRe = l(t.illegal)), null == t.relevance && (t.relevance = 1), t.contains || (t.contains = []), t.contains = Array.prototype.concat.apply([], t.contains.map(function (e) {
          return (n = "self" === e ? t : e).variants && !n.cached_variants && (n.cached_variants = n.variants.map(function (e) {
            return c(n, {
              variants: null
            }, e);
          })), n.cached_variants || n.endsWithParent && [c(n)] || [n];
          var n;
        })), t.contains.forEach(function (e) {
          n(e, t);
        }), t.starts && n(t.starts, e);
        var i = t.contains.map(function (e) {
          return e.beginKeywords ? "\\.?(" + e.begin + ")\\.?" : e.begin;
        }).concat([t.terminator_end, t.illegal]).map(o).filter(Boolean);
        t.terminators = i.length ? l(i.join("|"), !0) : {
          exec: function () {
            return null;
          }
        };
      }
    }(s);
  }

  function R(e, n, o, t) {
    function l(e, n, t, r) {
      var a = '<span class="' + (r ? "" : O.classPrefix);
      return (a += e + '">') + n + (t ? "" : x);
    }

    function c() {
      d += null != f.subLanguage ? function () {
        var e = "string" == typeof f.subLanguage;
        if (e && !w[f.subLanguage]) return b(E);
        var n = e ? R(f.subLanguage, E, !0, i[f.subLanguage]) : N(E, f.subLanguage.length ? f.subLanguage : void 0);
        return 0 < f.relevance && (p += n.relevance), e && (i[f.subLanguage] = n.top), l(n.language, n.value, !1, !0);
      }() : function () {
        var e, n, t, r, a, i, s;
        if (!f.keywords) return b(E);

        for (r = "", n = 0, f.lexemesRe.lastIndex = 0, t = f.lexemesRe.exec(E); t;) r += b(E.substring(n, t.index)), a = f, i = t, s = g.case_insensitive ? i[0].toLowerCase() : i[0], (e = a.keywords.hasOwnProperty(s) && a.keywords[s]) ? (p += e[1], r += l(e[0], b(t[0]))) : r += b(t[0]), n = f.lexemesRe.lastIndex, t = f.lexemesRe.exec(E);

        return r + b(E.substr(n));
      }(), E = "";
    }

    function u(e) {
      d += e.className ? l(e.className, "", !0) : "", f = Object.create(e, {
        parent: {
          value: f
        }
      });
    }

    function r(e, n) {
      if (E += e, null == n) return c(), 0;

      var t = function (e, n) {
        var t, r;

        for (t = 0, r = n.contains.length; t < r; t++) if (h(n.contains[t].beginRe, e)) return n.contains[t];
      }(n, f);

      if (t) return t.skip ? E += n : (t.excludeBegin && (E += n), c(), t.returnBegin || t.excludeBegin || (E = n)), u(t), t.returnBegin ? 0 : n.length;

      var r,
          a,
          i = function e(n, t) {
        if (h(n.endRe, t)) {
          for (; n.endsParent && n.parent;) n = n.parent;

          return n;
        }

        if (n.endsWithParent) return e(n.parent, t);
      }(f, n);

      if (i) {
        var s = f;

        for (s.skip ? E += n : (s.returnEnd || s.excludeEnd || (E += n), c(), s.excludeEnd && (E = n)); f.className && (d += x), f.skip || (p += f.relevance), (f = f.parent) !== i.parent;);

        return i.starts && u(i.starts), s.returnEnd ? 0 : n.length;
      }

      if (r = n, a = f, !o && h(a.illegalRe, r)) throw new Error('Illegal lexeme "' + n + '" for mode "' + (f.className || "<unnamed>") + '"');
      return E += n, n.length || 1;
    }

    var g = y(e);
    if (!g) throw new Error('Unknown language: "' + e + '"');

    _(g);

    var a,
        f = t || g,
        i = {},
        d = "";

    for (a = f; a !== g; a = a.parent) a.className && (d = l(a.className, "", !0) + d);

    var E = "",
        p = 0;

    try {
      for (var s, m, v = 0; f.terminators.lastIndex = v, s = f.terminators.exec(n);) m = r(n.substring(v, s.index), s[0]), v = s.index + m;

      for (r(n.substr(v)), a = f; a.parent; a = a.parent) a.className && (d += x);

      return {
        relevance: p,
        value: d,
        language: e,
        top: f
      };
    } catch (e) {
      if (e.message && -1 !== e.message.indexOf("Illegal")) return {
        relevance: 0,
        value: b(n)
      };
      throw e;
    }
  }

  function N(t, e) {
    e = e || O.languages || u(w);
    var r = {
      relevance: 0,
      value: b(t)
    },
        a = r;
    return e.filter(y).forEach(function (e) {
      var n = R(e, t, !1);
      n.language = e, n.relevance > a.relevance && (a = n), n.relevance > r.relevance && (a = r, r = n);
    }), a.language && (r.second_best = a), r;
  }

  function p(e) {
    return O.tabReplace || O.useBR ? e.replace(i, function (e, n) {
      return O.useBR && "\n" === e ? "<br>" : O.tabReplace ? n.replace(/\t/g, O.tabReplace) : "";
    }) : e;
  }

  function n(e) {
    var n,
        t,
        r,
        a,
        i,
        s,
        o,
        l,
        c,
        u,
        g = function (e) {
      var n,
          t,
          r,
          a,
          i = e.className + " ";
      if (i += e.parentNode ? e.parentNode.className : "", t = M.exec(i)) return y(t[1]) ? t[1] : "no-highlight";

      for (n = 0, r = (i = i.split(/\s+/)).length; n < r; n++) if (d(a = i[n]) || y(a)) return a;
    }(e);

    d(g) || (O.useBR ? (n = document.createElementNS("http://www.w3.org/1999/xhtml", "div")).innerHTML = e.innerHTML.replace(/\n/g, "").replace(/<br[ \/]*>/g, "\n") : n = e, i = n.textContent, r = g ? R(g, i, !0) : N(i), (t = E(n)).length && ((a = document.createElementNS("http://www.w3.org/1999/xhtml", "div")).innerHTML = r.value, r.value = function (e, n, t) {
      function r() {
        return e.length && n.length ? e[0].offset !== n[0].offset ? e[0].offset < n[0].offset ? e : n : "start" === n[0].event ? e : n : e.length ? e : n;
      }

      function a(e) {
        l += "<" + f(e) + m.map.call(e.attributes, function (e) {
          return " " + e.nodeName + '="' + b(e.value).replace('"', "&quot;") + '"';
        }).join("") + ">";
      }

      function i(e) {
        l += "</" + f(e) + ">";
      }

      function s(e) {
        ("start" === e.event ? a : i)(e.node);
      }

      for (var o = 0, l = "", c = []; e.length || n.length;) {
        var u = r();

        if (l += b(t.substring(o, u[0].offset)), o = u[0].offset, u === e) {
          for (c.reverse().forEach(i); s(u.splice(0, 1)[0]), (u = r()) === e && u.length && u[0].offset === o;);

          c.reverse().forEach(a);
        } else "start" === u[0].event ? c.push(u[0].node) : c.pop(), s(u.splice(0, 1)[0]);
      }

      return l + b(t.substr(o));
    }(t, E(a), i)), r.value = p(r.value), e.innerHTML = r.value, e.className = (s = e.className, o = g, l = r.language, c = o ? v[o] : l, u = [s.trim()], s.match(/\bhljs\b/) || u.push("hljs"), -1 === s.indexOf(c) && u.push(c), u.join(" ").trim()), e.result = {
      language: r.language,
      re: r.relevance
    }, r.second_best && (e.second_best = {
      language: r.second_best.language,
      re: r.second_best.relevance
    }));
  }

  function t() {
    if (!t.called) {
      t.called = !0;
      var e = document.querySelectorAll("pre code");
      m.forEach.call(e, n);
    }
  }

  function y(e) {
    return e = (e || "").toLowerCase(), w[e] || w[v[e]];
  }

  var m = [],
      u = Object.keys,
      w = {},
      v = {},
      r = /^(no-?highlight|plain|text)$/i,
      M = /\blang(?:uage)?-([\w-]+)\b/i,
      i = /((^(<[^>]+>|\t|)+|(?:\n)))/gm,
      x = "</span>",
      O = {
    classPrefix: "hljs-",
    tabReplace: null,
    useBR: !1,
    languages: void 0
  };
  return a.highlight = R, a.highlightAuto = N, a.fixMarkup = p, a.highlightBlock = n, a.configure = function (e) {
    O = c(O, e);
  }, a.initHighlighting = t, a.initHighlightingOnLoad = function () {
    addEventListener("DOMContentLoaded", t, !1), addEventListener("load", t, !1);
  }, a.registerLanguage = function (n, e) {
    var t = w[n] = e(a);
    t.aliases && t.aliases.forEach(function (e) {
      v[e] = n;
    });
  }, a.listLanguages = function () {
    return u(w);
  }, a.getLanguage = y, a.inherit = c, a.IDENT_RE = "[a-zA-Z]\\w*", a.UNDERSCORE_IDENT_RE = "[a-zA-Z_]\\w*", a.NUMBER_RE = "\\b\\d+(\\.\\d+)?", a.C_NUMBER_RE = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)", a.BINARY_NUMBER_RE = "\\b(0b[01]+)", a.RE_STARTERS_RE = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", a.BACKSLASH_ESCAPE = {
    begin: "\\\\[\\s\\S]",
    relevance: 0
  }, a.APOS_STRING_MODE = {
    className: "string",
    begin: "'",
    end: "'",
    illegal: "\\n",
    contains: [a.BACKSLASH_ESCAPE]
  }, a.QUOTE_STRING_MODE = {
    className: "string",
    begin: '"',
    end: '"',
    illegal: "\\n",
    contains: [a.BACKSLASH_ESCAPE]
  }, a.PHRASAL_WORDS_MODE = {
    begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/
  }, a.COMMENT = function (e, n, t) {
    var r = a.inherit({
      className: "comment",
      begin: e,
      end: n,
      contains: []
    }, t || {});
    return r.contains.push(a.PHRASAL_WORDS_MODE), r.contains.push({
      className: "doctag",
      begin: "(?:TODO|FIXME|NOTE|BUG|XXX):",
      relevance: 0
    }), r;
  }, a.C_LINE_COMMENT_MODE = a.COMMENT("//", "$"), a.C_BLOCK_COMMENT_MODE = a.COMMENT("/\\*", "\\*/"), a.HASH_COMMENT_MODE = a.COMMENT("#", "$"), a.NUMBER_MODE = {
    className: "number",
    begin: a.NUMBER_RE,
    relevance: 0
  }, a.C_NUMBER_MODE = {
    className: "number",
    begin: a.C_NUMBER_RE,
    relevance: 0
  }, a.BINARY_NUMBER_MODE = {
    className: "number",
    begin: a.BINARY_NUMBER_RE,
    relevance: 0
  }, a.CSS_NUMBER_MODE = {
    className: "number",
    begin: a.NUMBER_RE + "(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",
    relevance: 0
  }, a.REGEXP_MODE = {
    className: "regexp",
    begin: /\//,
    end: /\/[gimuy]*/,
    illegal: /\n/,
    contains: [a.BACKSLASH_ESCAPE, {
      begin: /\[/,
      end: /\]/,
      relevance: 0,
      contains: [a.BACKSLASH_ESCAPE]
    }]
  }, a.TITLE_MODE = {
    className: "title",
    begin: a.IDENT_RE,
    relevance: 0
  }, a.UNDERSCORE_TITLE_MODE = {
    className: "title",
    begin: a.UNDERSCORE_IDENT_RE,
    relevance: 0
  }, a.METHOD_GUARD = {
    begin: "\\.\\s*" + a.UNDERSCORE_IDENT_RE,
    relevance: 0
  }, a;
});